<?php

class m_form_actions_AjaxMarkAsReadAction extends m_backoffice_extends_Action
{
	public function execute()
	{
        $docId = $this->getRequestParameter('docId');
        $docLang = $this->getRequestParameter('docLang');
        $doc = $this->getRequestDocument();
        if($doc->getPublicationstatus() == 'NEW')
        {
            $doc->setPublicationstatus('READ');
        }
        else
        {
            $doc->setPublicationstatus('NEW');
        }

        $doc->save();

		return f_core_Routing::getUrl('showRecordWoRead', array('docId' => $docId, 'docLang' => $docLang));
	}	
}